CSharpTest.Net
UsageCounter Constructor(String,Object[])
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Threading Namespace > UsageCounter Class > UsageCounter Constructor : UsageCounter Constructor(String,Object[])

nameFormat
arguments

Glossary Item Box

Creates a composite name with the format and arguments specified

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal nameFormat As String, _
   ByVal ParamArray arguments() As Object _
)
C# 
public UsageCounter( 
   string nameFormat,
   params object[] arguments
)

Parameters

nameFormat
arguments

Example

Library/Library.Test/TestUsageCounter.cs

C#Copy Code
using (UsageCounter counter = new UsageCounter("some global name"))
    Assert.AreEqual("some global name", counter.Name);
using (UsageCounter counter = new UsageCounter(@"{0}\Item-{1}", "Global", 1))
    Assert.AreEqual(@"Global\Item-1", counter.Name);
VB.NETCopy Code
Using counter As New UsageCounter("some global name")
    Assert.AreEqual("some global name", counter.Name)
End Using
Using counter As New UsageCounter("{0}\Item-{1}", "Global", 1)
    Assert.AreEqual("Global\Item-1", counter.Name)
End Using

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys